﻿@model MSAcademic.v2.Web.Areas.Admin.Models.Tag.TagListModel

@{
    ViewBag.Title = "Pregled i upravljanje tagovima";
}

<script type="text/javascript"> 
    $(function () {
        $('.tag-cloud-wrapper .edit').on('mousedown', function () {
            msacademic.dialogPopup( $(this).data('url'));
        })
    });
</script>

<h2>Pregled i upravljanje tagovima</h2>

<div class="tag-list"> 

    @using (Html.BeginForm())
    {
        @Html.TextBoxFor(x => x.NewTagName, new { @placeholder =  "Dodaj novi tag" })
  
        <div class="actions-wrapper"> <a href="#" class="positive submit">Dodaj novi tag</a> </div>
    }         

    <h2> Tagovi trenutno u sustavu </h2>

    <div class="tag-cloud-wrapper">
        <ul>
        @foreach (var tag in Model.Tags)
        {
            <li> 
                <a data-url="@Url.RouteUrl("EditTagAdmin", new { tagId = tag.Id })" class="edit"> @tag.Name </a>   
                <a href="@Url.RouteUrl("DeleteTagAdmin", new { tagId = tag.Id })" class="delete"> <img src="~/Areas/Admin/Content/Images/delete.png" /> </a>
            </li>
        } 
        </ul>
    </div>

</div>